package hibari.client.ui;

import hibari.client.Configuration;

import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.InputElement;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;

public class DonateButton extends Composite {

	private static DonateButtonUiBinder uiBinder = GWT.create(DonateButtonUiBinder.class);

	@UiField
	protected InputElement itemNumberField;

	@UiField
	protected InputElement itemNameField;

	@UiField
	protected InputElement businessField;

	interface DonateButtonUiBinder extends UiBinder<Widget, DonateButton> {
	}

	public DonateButton() {
		initWidget(uiBinder.createAndBindUi(this));
		this.businessField.setValue(Configuration.PAYPAL_ID);
	}

	protected long weekNumber;

	public long getWeekNumber() {
		return this.weekNumber;
	}

	public void setWeekNumber(long weekNumber) {
		if (this.weekNumber == weekNumber) {
			return;
		}
		this.weekNumber = weekNumber;
		this.itemNumberField.setValue(Long.toString(weekNumber).trim());
		this.itemNameField.setValue("Week:" + weekNumber);
	}
}
